﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace weba
{
    public partial class addkehu : System.Web.UI.Page
    {
        sjklqDataContext sj = new sjklqDataContext();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void BtnSaveUserInfo_Click(object sender, EventArgs e)
        {
            T_UserInfo infnew = new T_UserInfo();
            infnew.T_UserState = Convert.ToByte("1") ;
            //客户类型
            infnew.T_UserType = Convert.ToByte(DDlClass.SelectedValue);
            //客户来源
            infnew.T_UserFrom = Convert.ToByte(DDLFrom.SelectedValue);
            //客户等级
            infnew.T_UserLeave = Convert.ToByte(DDLLeave.SelectedValue);
            //描述
            infnew.T_Remark = Server.HtmlEncode(txtRemark.Value.Trim());
            //省份
            infnew.T_Province = Server.HtmlEncode(DDLProvince.SelectedItem.Text);
           
            infnew.T_Tel = Server.HtmlEncode(txtTel.Value.Trim());
            infnew.T_QQ = Server.HtmlEncode(txtQQ.Value);
            infnew.T_Sex = (RBMan.Checked) ? "男" : "女";
            infnew.T_PostCode = Server.HtmlEncode(txtPost.Value.Trim());
            infnew.T_WebUrl = Server.HtmlEncode(txtWebUrl.Value.Trim());
            infnew.T_CompanyName = Server.HtmlEncode(txtCompanyName.Value.Trim());
            infnew.T_Email = Server.HtmlEncode(txtMail.Value.Trim());
            infnew.T_Fax = Server.HtmlEncode(txtFax.Value.Trim());
            infnew.T_Mobile = Server.HtmlEncode(txtMoblie.Value.Trim());
            infnew.T_Address = Server.HtmlEncode(txtAdress.Value.Trim());
            infnew.T_Person = Server.HtmlEncode(txtPerson.Value.Trim());
            infnew.T_NowService = DropDownList1.SelectedItem.Text.ToString();
            sj.T_UserInfo.InsertOnSubmit(infnew);
            sj.SubmitChanges();
            Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "", "alert('添加成功')", true);
           Response.Redirect("usersvc.aspx");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
          //  Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "", "alert('添加成功')", true);
        }
    }
}